<template>


    <!-- <textarea  :placeholder="textareaObj.placeholder" @blur="bindTextAreaBlur" auto-height/> -->

    <u-input v-model="value" 
    :type="type"  
    :auto-height="autoHeight"  
    :placeholder="textareaObj.placeholder"
     :disabled = 'disabled'
    class="testStyle"/>

    
</template>


<script>
export default {

        props: {
        formObj: {
            type: Object,
            
        }
       
    },
    data () {
        return {
            textareaObj : {},
            value: '',
            type: 'textarea',
           
            autoHeight: true,
             disabled: false



        }
    },


    mounted() {
        
        this.textareaObj = this.formObj
        this.formObj.value? this.disabled = true : this.disabled = false
        this.value = this.formObj.value


    },

    watch: {
        value(newValue, oldValue) {
       
              var obj = {
                key: this.textareaObj.name,
                value: newValue
            }
            this.$emit('childFn',obj)
	
    }
    },




    methods: {
        // bindTextAreaBlur(e) {
        //     var obj = {
        //         key: this.textareaObj.name,
        //         value: e.target.value
        //     }
        //     this.$emit('childFn',obj)
		// },
    }
}
</script>

<style lang="less" scoped>

.testStyle{
     /deep/
    .uni-textarea-placeholder {
        top:15px 
    }
}

</style>